package com.i2silly.wxbot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.i2silly.wxbot.dao.BotChatroomMapper;
import com.i2silly.wxbot.entity.BotChatroom;
import com.i2silly.wxbot.service.IBotChatroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: wx-bot
 * @description：
 * @author: i2silly
 * @date: 2020年11月26日 11:49:04
 */
@Service
public class BotChatroomServiceImpl extends ServiceImpl<BotChatroomMapper, BotChatroom> implements IBotChatroomService {

    @Autowired
    private BotChatroomMapper mapper;

    @Override
    public boolean delByPid(String pid) {
        return mapper.deleteByPid(pid);
    }

    @Override
    public List<String> distinctChatroomId(String pid) {
        return mapper.distinctChatroomId(pid);
    }

    @Override
    public boolean delByChatroomIds(String pid, List<String> list) {
        return mapper.delChatroomIds(pid, list);
    }

    @Override
    public List<BotChatroom> listByChatroomIdAndPid(String chatroomId, String pid) {
        return mapper.selectByChatroomIdAndPid(chatroomId, pid);
    }

    @Override
    public boolean delByPidAndRoomId(String pid, String chatroomId) {
        return mapper.deleteByPidAndChatroomId(pid, chatroomId);
    }

    @Override
    public List<BotChatroom> listByPid(String pid) {
        return mapper.selectByPid(pid);
    }
}
